﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using eShop.Model;
using eShop.Business;

public partial class prod_gallery_zoom : System.Web.UI.Page
{
    private Int32 _PROD_ID
    {
        get
        {
            try
            {
                if (HttpContext.Current.Request.QueryString != null && !string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["id"]))
                {
                    return Convert.ToInt32(HttpContext.Current.Request.QueryString["id"]);
                }
                else
                {
                    return -1;
                }
            }
            catch
            {
                return -1;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadData();
        }
    }

    private void LoadData()
    {
        if (_PROD_ID != -1)
        {
            IList<ProductImage> additionalImages = ProductManager.GetProductAdditionalImagesByProductId(_PROD_ID);
            rptAdditionalViews.DataSource = additionalImages;
            rptAdditionalViews.DataBind();
        }
    }
}